package com.example.chamberlainserver.dto;

import javax.validation.constraints.*;

/**
 * 班级数据传输对象
 */
public class ClassDTO {

    @NotBlank(message = "班级名称不能为空")
    @Size(max = 100, message = "班级名称长度不能超过100个字符")
    private String className;

    @NotBlank(message = "班级代码不能为空")
    @Size(max = 20, message = "班级代码长度不能超过20个字符")
    private String classCode;

    @NotBlank(message = "年级不能为空")
    @Size(max = 10, message = "年级长度不能超过10个字符")
    private String grade;

    @NotBlank(message = "专业不能为空")
    @Size(max = 100, message = "专业长度不能超过100个字符")
    private String major;

    @NotBlank(message = "院系不能为空")
    @Size(max = 100, message = "院系长度不能超过100个字符")
    private String department;

    @Min(value = 0, message = "学生人数不能小于0")
    @Max(value = 200, message = "学生人数不能超过200")
    private Integer studentCount;

    @Min(value = 0, message = "状态值不能小于0")
    @Max(value = 2, message = "状态值不能大于2")
    private Integer status; // 0-停用 1-正常 2-毕业

    @Size(max = 500, message = "描述长度不能超过500个字符")
    private String description;

    // 构造函数
    public ClassDTO() {}

    public ClassDTO(String className, String classCode, String grade, String major, 
                   String department, Integer studentCount, Integer status, String description) {
        this.className = className;
        this.classCode = classCode;
        this.grade = grade;
        this.major = major;
        this.department = department;
        this.studentCount = studentCount;
        this.status = status;
        this.description = description;
    }

    // Getter 和 Setter 方法
    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getClassCode() {
        return classCode;
    }

    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public Integer getStudentCount() {
        return studentCount;
    }

    public void setStudentCount(Integer studentCount) {
        this.studentCount = studentCount;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return "ClassDTO{" +
                "className='" + className + '\'' +
                ", classCode='" + classCode + '\'' +
                ", grade='" + grade + '\'' +
                ", major='" + major + '\'' +
                ", department='" + department + '\'' +
                ", studentCount=" + studentCount +
                ", status=" + status +
                ", description='" + description + '\'' +
                '}';
    }
}